<?php

require_once 'library/loader.php';

Settings::getInstance()->setIni(SITE_PATH . DIRSEP . 'settings' . DIRSEP . 'settings.ini');

// Load auth
$auth = Auth::getInstance();
$registry->auth = $auth;

// Load View
$view = new View($registry);
$registry->view = $view;

// Load router
$router = new Router($registry);
$registry->router = $router;

// Set router modus
$router->setRouteModus(ROUTER_MODE_NORMAL);

// Set controller path
$router->setControllerPath(SITE_PATH . 'controller');

// Set layout, could be changed in a controller
$view->setLayoutPath('template');
$view->setLayout('default');

$router->delegate();